<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>oldbesselioldbesseljoldbesselkoldbessely</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 24/02/2006</div>
    <p>
      <b>oldbesseli</b> - Modified Bessel functions of the first
  kind (I sub alpha).</p>
    <p>
      <b>oldbesselj</b> - Bessel functions of the first kind (J
  sub alpha).</p>
    <p>
      <b>oldbesselk</b> - Modified Bessel functions of the second
  kind (K sub alpha).</p>
    <p>
      <b>oldbessely</b> - Bessel functions of the second kind (Y
  sub alpha).</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>y = oldbesseli(alpha,x)</tt>
      </dd>
      <dd>
        <tt>y = oldbesseli(alpha,x,ice)</tt>
      </dd>
      <dd>
        <tt>y = oldbesselj(alpha,x)</tt>
      </dd>
      <dd>
        <tt>y = oldbesselk(alpha,x)</tt>
      </dd>
      <dd>
        <tt>y = oldbesselk(alpha,x,ice)</tt>
      </dd>
      <dd>
        <tt>y = oldbessely(alpha,x)</tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>x</b>
        </tt>: real vector with non negative entries</li>
      <li>
        <tt>
          <b>alpha</b>
        </tt>: real vector with non negative entries regularly spaced with
          increment equal to one <tt>
          <b>alpha=alpha0+(n1:n2)</b>
        </tt>
      </li>
      <li>
        <tt>
          <b>ice</b>
        </tt>: integer flag, with default value 1</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>These functions are obsolete, use <a href="bessel.htm">
        <tt>
          <b>besseli</b>
        </tt>
      </a>,
    <a href="bessel.htm">
        <tt>
          <b>besselj</b>
        </tt>
      </a>, <a href="bessel.htm">
        <tt>
          <b>besselk</b>
        </tt>
      </a>, <a href="bessel.htm">
        <tt>
          <b>bessely</b>
        </tt>
      </a> instead.
    Note however that the semantics of these two sets of functions are
    different.</p>
    <p>
      <tt>
        <b>oldbesseli(alpha,x)</b>
      </tt> computes modified Bessel functions of
    the first kind (I sub alpha), for real, non-negative order
    <tt>
        <b>alpha</b>
      </tt> and real non negative argument <tt>
        <b>x</b>
      </tt>.
    <tt>
        <b>besseli(alpha,x,2)</b>
      </tt> computes
    <tt>
        <b>besseli(alpha,x).*exp(-x)</b>
      </tt>.</p>
    <p>
      <tt>
        <b>oldbesselj(alpha,x)</b>
      </tt> computes Bessel functions of the first
    kind (J sub alpha), for real, non-negative order <tt>
        <b>alpha</b>
      </tt> and
    real non negative argument <tt>
        <b>x</b>
      </tt>.</p>
    <p>
      <tt>
        <b>oldbesselk(alpha,x)</b>
      </tt> computes modified Bessel functions of
    the second kind (K sub alpha), for real, non-negative order
    <tt>
        <b>alpha</b>
      </tt> and real non negative argument <tt>
        <b>x</b>
      </tt>.
    <tt>
        <b>besselk(alpha,x,2)</b>
      </tt> computes
    <tt>
        <b>besselk(alpha,x).*exp(x)</b>
      </tt>.</p>
    <p>
      <tt>
        <b>oldbessely(alpha,x)</b>
      </tt> computes Bessel functions of the
    second kind (Y sub alpha), for real, non-negative order <tt>
        <b>alpha</b>
      </tt>
    and real non negative argument <tt>
        <b>x</b>
      </tt>.</p>
    <p>
      <tt>
        <b>alpha</b>
      </tt> and <tt>
        <b>x</b>
      </tt> may be vectors. The output is
    <tt>
        <b>m</b>
      </tt>-by-<tt>
        <b>n</b>
      </tt> with <tt>
        <b>m = size(x,'*')</b>
      </tt>,
    <tt>
        <b>n = size(alpha,'*')</b>
      </tt> whose <tt>
        <b>(i,j)</b>
      </tt> entry is
    <tt>
        <b>oldbessel?(alpha(j),x(i))</b>
      </tt>.</p>
    <h3>
      <font color="blue">Remarks</font>
    </h3>
    <dl>
      <p>Y_alpha and J_alpha Bessel functions are 2 independant solutions of the
    Bessel 's differential equation :</p>
      <pre>2 2 2 x y" + x y' + (x - alpha ) y = 0 , alpha &gt;=
    0</pre>
      <p>K_alpha and I_alpha modified Bessel functions are 2 independant
    solutions of the modified Bessel 's differential equation :</p>
      <pre>2 2 2 x y" + x y' - (x + alpha ) y = 0 , alpha &gt;=
    0</pre>
    </dl>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>
// example #1: display some I Bessel functions
x = linspace(0.01,10,5000)';
y = oldbesseli(0:4,x);
ys = oldbesseli(0:4,x,2);
xbasc()
subplot(2,1,1)
   plot2d(x,y, style=2:6, leg="I0@I1@I2@I3@I4", rect=[0,0,6,10])
   xtitle("Some modified Bessel functions of the first kind")
subplot(2,1,2)
   plot2d(x,ys, style=2:6, leg="I0s@I1s@I2s@I3s@I4s", rect=[0,0,6,1])
   xtitle("Some modified scaled Bessel functions of the first kind")

// example #2 : display some J Bessel functions
x = linspace(0,40,5000)';
y = besselj(0:4,x);
xbasc()
plot2d(x,y, style=2:6, leg="J0@J1@J2@J3@J4")
xtitle("Some Bessel functions of the first kind")

// example #3 : use the fact that J_(1/2)(x) = sqrt(2/(x pi)) sin(x)
//              to compare the algorithm of besselj(0.5,x) with
//              a more direct formula 
x = linspace(0.1,40,5000)';
y1 = besselj(0.5, x);
y2 = sqrt(2 ./(%pi*x)).*sin(x);
er = abs((y1-y2)./y2);
ind = find(er &gt; 0 &amp; y2 ~= 0);
xbasc()
subplot(2,1,1)
   plot2d(x,y1,style=2)
   xtitle("besselj(0.5,x)")
subplot(2,1,2)
   plot2d(x(ind), er(ind), style=2, logflag="nl")
   xtitle("relative error between 2 formulae for besselj(0.5,x)") 


// example #4: display some K Bessel functions
x = linspace(0.01,10,5000)';
y = besselk(0:4,x);
ys = besselk(0:4,x,1);
xbasc()
subplot(2,1,1)
   plot2d(x,y, style=0:4, leg="K0@K1@K2@K3@K4", rect=[0,0,6,10])
   xtitle("Some modified Bessel functions of the second kind")
subplot(2,1,2)
   plot2d(x,ys, style=0:4, leg="K0s@K1s@K2s@K3s@K4s", rect=[0,0,6,10])
   xtitle("Some modified scaled Bessel functions of the second kind")

// example #5: plot severals Y Bessel functions
x = linspace(0.1,40,5000)'; // Y Bessel functions are unbounded  for x -&gt; 0+
y = bessely(0:4,x);
xbasc()
plot2d(x,y, style=0:4, leg="Y0@Y1@Y2@Y3@Y4", rect=[0,-1.5,40,0.6])
xtitle("Some Bessel functions of the second kind")
  </pre>
    <h3>
      <font color="blue">Author</font>
    </h3>
    <p>W. J. Cody, L. Stoltz (code from Netlib (specfun))</p>
  </body>
</html>
